<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="blog/index/include_blog::header">
</head>
<body>
<iframe id="bground" class="visible-lg-block" src="" width="100%" height="100%" style="z-index: -1;width: 100%;position:fixed "></iframe>
	<nav th:include="blog/index/include_blog::nav" class="navbar navbar-default navbar-fixed-top"></nav><!-- 上移悬停下移消失navbar-custom -->
	<div class="col-md-12">
		<header class="honey-header" style="background-color: rgba(124,184,199,0.7);border-radius:20px 20px">
			<div class="container">
				<div class="row">
					<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
						<div class="head-top text-center">
							<h1 th:text="${content.title}"></h1>
							<b class="meta" style="cursor:pointer;">作者: <a class="adt" th:value="${content.createdId}" title="去作者主页看看.." onclick="openuser(this)"
								th:text="${content.author}"></a>&nbsp;&nbsp;发布时间：[[${#dates.format(content.createDate, 'yyyy/mm/dd HH:mm')}]]&nbsp;&nbsp;<br>点击量:<i class="glyphicon glyphicon-eye-open"
								>[[${contentdetail.views}]]</i>&nbsp;&nbsp;
								<br>
								<b class="hidden1" id="favoritesspan" >收藏:<a id="favorites" class="glyphicon glyphicon-heart-empty" 
								th:text="${contentdetail.favorites}" onclick="favorites()" style="text-decoration:none;"></a></b>
								
								<b class="hidden1" id="zanspan" >点赞:<a id="zan" class="fa fa-thumbs-o-up" 
								th:text="${contentdetail.zan}" onclick="zan()" style="text-decoration:none;"></a></b>
								<span class="hidden">
									<span id="cid">[[${content.contentId}]]</span>
									<span id="iszan">[[${iszan}]]</span>
									<span id="isfavorites">[[${isfavorites}]]</span>
									<span id="isopencomment">[[${content.allowComment}]]</span>
								</span>
								<!-- <input id="isopencomment"  type="hidden" th:value="${content.allowComment}"/> -->
								
							</b>
							<div class="actions hidden">
                                <a id="dz" class="btn btn-xs btn-success" onclick="zan()"><i class="fa fa-thumbs-up"></i> 点赞</a>
                                <a id="sc" class="btn btn-xs btn-success" onclick="favorites()"><i class="fa fa-heart"></i> 收藏</a>
                            </div>
						</div>
					</div>
				</div>
			</div>
		</header>
	</div>
	<!-- 左边内容栏开始 -->
	<div class="col-sm-9 " style="background-color:rgba(0,0,0,0)">
		<article>
			<div class="col-sm-9 col-md-offset-1">
				<div id="contents" th:utext="${content.content}"></div>
			</div>
			<hr>
			<!-- 评论开始 -->
            <span id="ly">&emsp;&emsp;&emsp;留言：</span>
            <div th:if="${content.allowComment} eq 1">
	            <!-- 评论框 -->
	            <div class="col-sm-9 col-md-offset-1" th:include="blog/blogcomment/commenter::commenter"></div>
	        	<!-- 评论展示开始 -->
	            <div class="col-sm-9 col-md-offset-1" id="commentlist">
	                <div id="incomeNum"></div>
					<div class="clearfix">
						<p id="flagLoaded" class="blog-allcontent"><span>没有更多留言了</span></p>
						<a id="flagLoad" style="display: none;" class="btn btn-secondary float-right" href="javascript:void(0)" onclick="nextPage()"><span>更早评论 &rarr;</span></a>
					</div>
	            </div>
	            <!-- 评论展示结束 -->
	         </div>
	         <div class="post-preview text-center" th:if="${content.allowComment} ne 1">
	         	<p class="fontsize40 textzhi xzyz">&emsp;&emsp;&emsp;该作者暂未开启留言功能!!!</p>
	         	<img class="xzyz" src="/img/logo/honey-b.png" alt="">
	         </div>
	         <!-- 评论结束 -->
	         <hr>
	         <br>
		</article>
	</div>
	<!-- 左边内容栏结束 -->
	<!-- 右边悬浮栏开始 -->
	<div class="col-sm-3 visible-lg-block" id="go" style=" overflow-y:scroll; height:80%;margin-top:5%">
		<!-- 随机推荐开始 -->
		<div class="panel panelboder">
			<div class="panel-heading">
				<h3 class="panel-title">
				     <span>随机推荐！！！</span>
				</h3>
			</div>
			<hr>
			<div class="panel-body">
				<div class="post-heading">
					<table class="table">
						<tr th:each="rand : ${randContent}">
							<td><span class="contenttitle hand textdanlan" th:text="${rand.title}" onclick="opencontent(this)" th:value="${rand.contentId}"></span></td>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<div class="panel panelboder" id="jj">
			<div class="panel-heading">
				<h3 class="panel-title">
				     <span>网站简介！！！</span>
				</h3>
			</div>
			<hr>
			<div class="panel-body">
                <div class="post-heading hand textdanlan" th:utext="${@content.getContent(2).content}">
				</div>
			</div>
		</div>
		<!-- 随机推荐结束 -->
		<br>
				
	</div>
	<!-- 右边悬浮栏结束 -->

	<!-- 评论开始js -->
	<div th:include="blog/index/include_blog::footer"></div>
	<div th:include="include::honeypl"></div>
	<div th:include="include::xf"></div>
	<!-- 评论结束 -->
	<script type="text/javascript" th:inline="javascript">
		var contentid=$("#cid").text();
		var isopencomment=$('#isopencomment').text();
		var pagenum = 1;
		var pagesize=10;
		$(function(){
				//调用评论honeypl.js
				//加载评论列表
				if(isopencomment==1){
					commentList(pagenum,contentid);
				}
				
				var iszan=$("#iszan").text();
				var isfavorites=$("#isfavorites").text();
				if(iszan=='false'){
					$("#zan").attr("class","fa fa-thumbs-up");
					$("#dz").attr("class","btn btn-xs btn-danger");
					document.getElementById("zan").style.color="red";
				}else{
					$("#zan").attr("class","fa fa-thumbs-o-up");
					$("#dz").attr("class","btn btn-xs btn-success");
					document.getElementById("zan").style.color="";
				}
				if(isfavorites=='false'){
					$("#favorites").attr("class","glyphicon glyphicon-heart");
					$("#sc").attr("class","btn btn-xs btn-danger");
					document.getElementById("favorites").style.color="red";
				}else{
					$("#favorites").attr("class","glyphicon glyphicon-heart-empty");
					$("#sc").attr("class","btn btn-xs btn-success");
					document.getElementById("favorites").style.color="";
				}
				//zan();
				//collection();
		});
        
		//更多评论
	    function nextPage() {
			commentList(currentPage * limit,contentid);
		}
		    
			
	</script>
</body>
</html>
